<template>
  <van-overlay :show="show" @click="click"  z-index="10" :lock-scroll='false'>
    <div class="description">
      <div class="inner">
        <div class="image">
          <img :src="image" />
          <span class="name">{{ name }}</span>
        </div>
        <van-divider />
        <div v-if="tags">
          标签：<van-tag round v-for="(tag,index) of tags" :key="index" class="tag">{{ tag }}</van-tag>
        </div>
        <div class="content" v-html="content">
          <!-- {{ description }} -->
        </div>
      </div>
    </div>
  </van-overlay>
</template>
<script>
export default {
  props: {
    show: {
      type: Boolean,
      default: false
    },
    name: {
      type: String
    },
    image: {
      type: String
    },
    tags: {
      type: Array
    },
    description: {
      type: String
    }
  },
  computed: {
    content() {
      // return this.description
      return  (this.description + '').replace(/\n/g,"<br/>")
    }
  },
  methods: {
    click() {
      this.$emit('update:show', false)
    }
  }
}
</script>
<style lang="less" scoped>
@import '~@/style/variable';

.description{
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: white;
  .inner {
    width: 90%;
    height: 90%;
    overflow: auto;
    .image{
      display: flex;
      flex-direction: column;
      align-items: center;
      >img{
        width: 50%;
        border-radius: 10px;
      }
      .name{
        margin-top: 15px;
        font-size: @font-size-large;
      }
    }
    .tag{
      margin-right: 5px;
    }
    .content{
      margin-top: 10px;
      line-height: 1.5;
    }
  }
  .inner::-webkit-scrollbar {
    display: none;
  }
}
</style>